package com.spddr.pmos.jpa;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class UserKeyId implements java.io.Serializable {
	private static final long serialVersionUID = 1L;

	private long user;
	private int keyid;

	public UserKeyId() {
	}

	public UserKeyId(long user, int keyid) {
		this.user = user;
		this.keyid = keyid;
	}

	@Column(name = "user_", nullable = false)
	public long getUser() {
		return this.user;
	}

	public void setUser(long user) {
		this.user = user;
	}

	@Column(name = "keyid", nullable = false)
	public int getKeyid() {
		return this.keyid;
	}

	public void setKeyid(int keyid) {
		this.keyid = keyid;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + keyid;
		result = prime * result + (int) (user ^ (user >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UserKeyId other = (UserKeyId) obj;
		if (keyid != other.keyid)
			return false;
		if (user != other.user)
			return false;
		return true;
	}
}